The `token.disconnectAll()` call here is not going to work: The method is
provided by gjs as convenience for native JS objects (added to an object
using `Signals.addSignalMethods()`). The token here meanwhile is a GObject,
which doesn't have a `disconnectAll()` method.
To make it (hopefully) work as intended, use the convenience functions
that we actually do add to GObjects, that is `connectObject()` and
`disconnectObject()`.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3796>
(cherry picked from commit
b3e5a524d382c227c2a75838791f315812c07265)
_addToken(token) {
this._updateToken(token);
- token.connect('g-properties-changed', (proxy, properties) => {
+ token.connectObject('g-properties-changed', (proxy, properties) => {
const isInsertedChanged = !!properties.lookup_value('IsInserted', null);
if (isInsertedChanged) {
this._updateToken(token);
else
this.emit('smartcard-removed', token);
}
- });
+ }, this);
// Emit a smartcard-inserted at startup if it's already plugged in
if (token.IsInserted)
if (this._loginToken === token)
this._loginToken = null;
- token.disconnectAll();
+ token.disconnectObject(this);
}
hasInsertedTokens() {